<style>

	.finaSeDiv{
		float:left;
		padding:10px 0 5px 10px;
		width:200px;
	}
	.finaSeDiv label{
		width:53px;
		float: left;
	}
	.table-btn-separator {
    float: center;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #fff;
  /*  width: 1200px;*/
}
</style>

<div id="tool-mes-vin">

<table>

<tr>
    <td>
    <if condition="authCheck1('Home/Vinpic/importposition')">

            <a href="#"  class="easyui-linkbutton" onclick='show_add_vinposition()'
               data-options="iconCls:'icon-standard-folder-page',plain:true">上传车架图</a>

        <a href="#"  class="easyui-linkbutton" onclick='show_add_vinpositionfj()'
           data-options="iconCls:'icon-standard-arrow-up',plain:true">上传附件</a>


            <div class="datagrid-btn-separator"></div>

    </if>
    <if condition="authCheck1('Home/Vinpic/sign')">

        <a href="#"  class="easyui-linkbutton" onclick='signvinpic()'
           data-options="iconCls:'icon-standard-accept',plain:true">签收</a>

        <a href="#"  class="easyui-linkbutton" onclick='questionvin()'
           data-options="iconCls:'icon-standard-accept',plain:true">提交问题</a>

    </if>
        <a href="#"  class="easyui-linkbutton" onclick='downloadvinfj()'
           data-options="iconCls:'icon-standard-anchor',plain:true">下载附件</a>
    </td>
</tr>
<tr>



 <td>
装配号：<input id="mjhh" name="jhh" class="easyui-textbox" data-options="" style="width:100px"> 
计生号：<input id="msjjhh" name="sjjhh" class="easyui-textbox" data-options="" style="width:100px"> 
流水号：<input id="mlsh" name="lsh" class="easyui-textbox" data-options="prompt:'请输入单个流水号…'" style="width:100px">
     配置:<input id="mcjpz" name="cjpz" class="easyui-textbox" data-options="prompt:''" style="width:100px">
     车架号:<input id="cjid" name="cjh" class="easyui-textbox" data-options="prompt:''" style="width:100px">




     <a href="#" class="easyui-linkbutton"  onclick="search_mes()" data-options="iconCls:'icon-search',plain:'true'">搜索</a>
   </td>
   <td>
     <div class="datagrid-btn-separator"></div>
 </td>




</tr>

</table>





</div>
<div id="tool-mes-vin-tj">
    asd
</div>

<div id="tool-cjtp">

    <a href="#" class="easyui-linkbutton"  onclick='showpictp()' data-options="iconCls:'icon-standard-application-edit',plain:true">查看图片</a>
    <a href="#" class="easyui-linkbutton"  onclick='guanliancjtvin()' data-options="iconCls:'icon-standard-application-edit',plain:true">关联</a>
    <a href="#" class="easyui-linkbutton"  onclick='delcjtvin()' data-options="iconCls:'icon-no',plain:true">删除</a>
</div>

<div id="vin_qes_dig" class="easyui-dialog" style="width: 606px; height: 221px; padding: 10px; overflow: hidden;"
     title="&nbsp;&nbsp;提交VIN码位置问题报告"
     data-options="iconCls:'icon-standard-folder-page',buttons:'#dlg-add-mes-vin',closed:true,resizable:true,closable:true">

    <form id="vin_qes_dig_form" name="vin_qes_dig_form" enctype="multipart/form-data" method="post">

        <table class="add_table">

            <tr>
                <td>
                    <div class="row_container">

                        <div class="inline">
                            <span class="add_label">问题描述：</span>
                            <input id="vin_content" name="content" class="easyui-textbox"
                                   data-options="iconCls:'',multiline:true,editable:true,required:true,prompt:'必填项……'"
                                   style="width:500px;height:100px;"/>
                        </div>

                    </div>


                </td>
            </tr>
            <tr>
                <td>
                    <div class="row_container">

                        <div class="inline">
                            <span class="add_label">图片附件：</span>
                            <input  name="pics[]" id="pics"  style="width:500px;"  data-options="multiple:true,buttonText:'上传图片',buttonIcon:'icon-standard-bullet-picture',buttonAlign:'right',accept:'image/*'"
                                    class="easyui-filebox">
                        </div>

                    </div>


                </td>
            </tr>


        </table>
    </form>


</div>
<div id="dlg-add-mes-vin">
    <div class="tool_tip" id="uploadlabel">

    </div>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="uploadvinqs()">提交</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'"
       onclick="javascript:$('#vin_qes_dig').dialog('close')">取消</a>
</div>

<script>


    function  showpictp(){
        // $(".imageFullScreen").html('')
        $('#showpicvin').window('open');
        var row = $('#cjtp-dg').datagrid("getSelected");
        var rowmes = $('#mesvin-dg').datagrid("getSelected");
        if(row){
            if(row.savepath!=null &&　row.savepath!='') {

                var tp = row.savepath
                var alts = row.name
                var pic = '<img src="__PUBLIC__/' + tp + '" alt="' + alts + '" class="vinpics">';
                $("#imageFullScreen").attr('src',"__PUBLIC__/" + tp);
                $("#imageFullScreen").attr('alts',alts);
            }
            var info=rowmes.sjjhh+"(" +rowmes.lshqj+")"


            $("#vinpicinfo").html(info)
            // $(".imageFullScreen").html(pic)
        }else{
            $.messager.alert("请选择", "请选择要查看的装配计划！", "info");
        }
    }

    /**
     * 关联老图
     */
    function guanliancjtvin(){
        var row = $('#cjtp-dg').datagrid("getSelected");
        var rowems = $('#mesvin-dg').datagrid("getSelected");

        if (row) {
            $.messager.confirm('确认', '您确定要关联此车架图纸到mes装配计划吗?', function (r) {
                if (r) {
                    $.post(APP + '/Home/Vinpic/guanliancjtvin', {
                        id:rowems.id,
                        row:row
                    }, function (data) {
                        if (data.status == 1) {
                            $.messager.alert('关联项目', data.message, 'info');
                            $("#mesvin-dg").datagrid("reload");
                        } else {
                            $.messager.show({ // show error message
                                title: '错误',
                                msg: data.message
                            });

                        }
                    }, 'json');
                }
            });


        } else {
            $.messager.alert("请选择", "请选择要关联的车间图纸！", "info");
        }

    }
    /**
     * 删除老图
     */
    function delcjtvin(){
        var row = $('#cjtp-dg').datagrid("getSelected");
        var rowems = $('#mesvin-dg').datagrid("getSelected");

        if (row) {
            $.messager.confirm('确认', '您确定要删除此图纸吗?', function (r) {
                if (r) {
                    $.post(APP + '/Home/Vinpic/delcjtvin', {
                        id:rowems.id,
                        row:row
                    }, function (data) {
                        if (data.status == 1) {
                            $.messager.alert('删除图片', data.msg, 'info');
                            $("#mesvin-dg").datagrid("reload");
                            $("#cjtp-dg").datagrid("reload");
                        } else {
                            $.messager.alert('删除图片', data.msg, 'error');
                        }
                    }, 'json');
                }
            });


        } else {
            $.messager.alert("请选择", "请选择要关联的车间图纸！", "info");
        }

    }
</script>

